<%@ Page Title="" Language="VB" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage(Of List(Of TeamObj))" %>

<%@ Import Namespace="SurvivorPool" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Survivor Pool - Winners
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Record the winners for Round <%=ViewData("CurrentRound").ToString()%></h2>
    <%=Html.ValidationSummary("Edit was unsuccessful. Please correct the errors and try again.")%>
    
    <h3><font color="purple"><i><%=ViewData("MainMsg").ToString()%></i></font></h3>
    
    <% Using Html.BeginForm()%>
    <fieldset>
        <legend>NCAA Teams</legend>
            <table class="data-table" cellpadding=2>
            <tr>
                <th scope="col">Team Name</th>
                <th scope="col">Region</th>
                <th scope="col">Seed</th>
                <th scope="col">Result</th>
            </tr>
            
        <%  Dim rowCount As Integer = 0
            For Each item In Model
                If rowCount Mod 2 = 0 Then Response.Write("<tr>") Else Response.Write("<tr class=""row-alternating"">")
         %>   
                <td><%=item.TeamName%></td>
                <td><%=item.Region%></td>
                <td><%=item.Seed%></td>
                <td>
                <% Dim myRound As Integer = ViewData("CurrentRound") %>
                    Won: <%=Html.RadioButton(item.TeamId.ToString(), "Win", item.IsWinnerForRound(myRound))%> &nbsp;&nbsp;                        
                    Loss: <%=Html.RadioButton(item.TeamId.ToString(), "Loss", item.IsLoserForRound(myRound))%> &nbsp;&nbsp;
                    Not Played: <%=Html.RadioButton(item.TeamId.ToString(), "NP", item.HasNotPlayedForRound(myRound))%> 
                  </td>
            </tr>
            
        <% rowCount += 1%>
        <% Next%>
        
        </table>
        <br />
        <input type="submit" class="savebtn" value="Save" />
    </fieldset>
    <% End Using%>
    
</asp:Content>
